/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bkcad;

import java.util.Scanner;

/**
 *
 * @author hoangpt
 */
public class HelloJava {

  public static final int NUMBER = 15;
  
  /**
   * 
   * @param args 
   */
  public static void main(String[] args) {
    System.out.println("Hello Java");
    System.out.println("Do you like java?");
    
    int _2hi = 5; //declare integer
    String msg = "Hello, how are you?"; //type name_of_indetifier value
    System.out.println(msg + _2hi);
    
    int numberOfDayInWeek = 7;
    String helloMorning = "Good morning";
    
    /*
     * STEP1: create connection
     * OK->goto 2, fail goto1
     */
    double ratio = 1.45;
    float multibyte = 1.3f; //primitive
    System.out.println("");
    
    /*
     * STEP2: get data from table customer
     */
    String vuiMsg = "Vui qua"; //wraper
    Double d = new Double("1.5");
    long l = d.longValue();
    System.out.println(d.toString());
    l = 150;
    
    
    /*
     * STEP3: bind data to Bean
     */
    System.out.print("n");
    System.out.print("Hahaha.\n");
    System.out.print("Cuoi deu gi the.\\");
    
    int x =1;
    System.out.println(x++);
    System.out.println(x);
    System.out.println(++x);
    
    int y = 5;
    
    if(x==4 & ++y==5){ //long
    } else if(y==7) {
  
    } else {
    
    }
    
    System.out.println(y);
    
    if (x==4 && ++y==5) { //short
      System.out.println("");
    } else {
      if (y==9) {
        System.out.println("");
      } else {
        System.out.println("");
      } 
    }
    
    switch (y) {
      case 1:
        System.out.println("");  
      case 2:
        System.out.println("");  
        break;
      default:
        //throw new AssertionError();
    }
    
    for (int i = 0; i < 10; i+=2) {
      System.out.print(i);
    }
    
    y = y+2; //the same with below
    y += 2;
    
    System.out.println(y);
    short y1 = (short) y;
    
    Scanner scan = new Scanner(System.in);
    System.out.print("Input a:");
    int a = scan.nextInt();
    System.out.println("a="+a);
  }
}
